package aole.visq.draw.undo;

import java.awt.image.BufferedImage;

import javax.swing.undo.AbstractUndoableEdit;

import aole.visq.draw.DrawApp;

public class UndoableDraw extends AbstractUndoableEdit {
	private static final long	serialVersionUID	= 1L;
	private BufferedImage		oldimg, newimg;
	private int					frame;
	private DrawApp				app;

	public UndoableDraw( DrawApp a, int f, BufferedImage o, BufferedImage n ) {
		app = a;
		frame = f;
		oldimg = o;
		newimg = n;
	}

	public void undo() {
		super.undo();
		app.setCurrentFrame( frame );
		app.drawImage( oldimg );
	}

	public void redo() {
		super.redo();
		app.setCurrentFrame( frame );
		app.drawImage( newimg );
	}
}